package com.skjanyou.applicationcase.websocket;

import java.net.InetSocketAddress;

import org.java_websocket.WebSocket;
import org.java_websocket.handshake.ClientHandshake;
import org.java_websocket.server.WebSocketServer;

public class ImageWebsocket extends WebSocketServer {
	
	
	public ImageWebsocket( int port ) {
		super( new InetSocketAddress(port) );
	}

	@Override
	public void onClose(WebSocket arg0, int arg1, String arg2, boolean arg3) {
		WebsocketSession.list.remove(arg0);
	}

	@Override
	public void onError(WebSocket arg0, Exception arg1) {
		WebsocketSession.list.remove(arg0);
	}

	@Override
	public void onMessage(WebSocket arg0, String arg1) {

	}

	@Override
	public void onOpen(WebSocket arg0, ClientHandshake arg1) {
		WebsocketSession.list.add(arg0);
	}

	@Override
	public void onStart() {

	}

}
